<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/index.less.css">
    <script src="${pageContext.request.contextPath}/js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css"
          href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" />

    <title>影片</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            text-decoration: none;
            list-style: none;
            border: 0;
        }

        .site-nav {
            z-index: 10000;
            width: 100%;
            background-color: #e4e4e4;
            border-bottom: 1px solid #eee;
            overflow: visible;
            position: fixed;
            left: 0px;
            top: 0px;
        }

        .site-nav div {
            margin: 0 auto;
            width: 1190px;
            height: 35px;
            background-color: #e4e4e4;
            z-index: 10002;
            position: relative;
            padding: 0 6px;
            line-height: 35px;
        }

        .site-nav div a {
            float: left;
            margin-right: 7px;
            font-size: 12px;
            color: #6C6C6C;
        }

        .head-wrap {
            padding-top: 36px;
            background-color: #fff;
            z-index: 100;
            /* border-bottom: 1px #e5e5e5 solid; */
        }

        .center-wrap {
            width: 990px;
            min-width: 990px;
            margin: 0 auto;
        }

        .left-wrap {
            float: left;
            width: 650px;
            padding: 0 20px !important;
            border: 1px solid #e5e5e5;
            overflow: hidden;
        }

        .tab-movie-tit {
            height: 60px;
            width: 100%;
            margin-bottom: 10px;
        }

        .tab-movie-tit a {
            display: block;
            margin-right: 30px;
            float: left;
            color: #999;
            font-size: 16px;
            margin-top: 32px;
            line-height: 26px;
            text-decoration: none;
        }

        .tab-movie-tit a.current {
            color: #3e3e3e;
            border-bottom: 2px #eb002a solid;
        }

        .nav-wrap {
            float: left;
        }
        .nav li:nth-child(2) a{
            border-bottom: 3px #eb002a solid;
            color: #eb002a;
        }
        .nav-wrap .nav {
            float: left;
            padding-top: 18px;
            display: block;
            margin-block-start: 1em;
            margin-block-end: 1em;
            margin-inline-start: 0px;
            margin-inline-end: 0px;
            padding-inline-start: 40px;
        }

        .nav li {
            float: left;
            color: #6b6b6b;
            line-height: 42px;
            width: 74px;
            height: 44px;
        }

        .nav li a {
            color: #666;
            font-size: 18px;
            float: left;
            padding: 0 14px;
            margin-right: 10px;
        }

        .movie-card-wrap {
            display: block;
            width: 161px;
            height: 273px;
            overflow: hidden;
            position: relative;
            padding-top: 9px;
            padding-right: 9px;
            float: left;
            margin-top: 10px;
            margin-right: 10px;
            margin-left: 19px;
            line-height: 0;
        }

        .movie-card-wrap .movie-card-buy {
            display: block;
            height: 40px;
            width: 224px;
            line-height: 40px;
            padding-left: 58px;
            background: #eb002a;
            color: #fff;
        }

        .movie-card .movie-card-name {
            position: absolute;
            bottom: 0;
            height: 56px;
            width: 100%;
        }

        .movie-card .movie-card-info {
            position: absolute;
            top: 0;
            left: 0;
            width: 160px;
            height: 224px;
            color: #fff;
        }

        .tab-movie-list{
            width: 610px;
        }
        .hover {
            transform: translateZ(0);
            position: relative;
            z-index: 100000;
            display: none;
            /* width: 330px;
            height: 100px; */
            float: left;
            margin-left: 170px;
        }

        .hover a {
            color: #000;
        }
    </style>


</head>

<body>

<c:import url="head.jsp" charEncoding="UTF-8" />

<div class="center-wrap">
    <div class="left-wrap" data-spm="w2" data-spm-max-idx="396">
        <div class="tab-control tab-movie-tit">
            <a class="tab-control-item current" id="re" href="#"> 正在热映 </a>
            <a class="tab-control-item" href="#">即将上映</a>
            <!--a class="more" href="#">查看全部&nbsp;&gt;</a-->
        </div>
        <div class="tab-content">
            <!-- 正在热映 -->
            <div class="tab-movie-list" style="display: inline-block;">

                <c:forEach var="film" items="${filmListData}">
                <div class="movie-card-wrap">
                    <a href="filmInfo?filmId=${film.f_id}" class="movie-card">
                        <div class="movie-card-poster">
                            <img width="160" height="224" src="${pageContext.request.contextPath}${film.img_path}">
                        </div>
                        <div class="movie-card-name">
                            <span class="bt-l">${film.f_name}</span>
                            <span class="bt-r">9.3</span>
                        </div>
                        <div class="movie-card-info">
                            <div class="movie-card-mask"></div>
                            <div class="movie-card-list">
                                <span>导演：${film.f_director}</span>
                                <span>主演：${film.f_players}</span>
                                <span>类型：${film.f_type}</span>
                                <span>地区：${film.f_country}</span>
                                <span>语言：汉语普通话</span>
                                <span>片长：${film.f_length}</span> </div>
                        </div>
                    </a>
                    <a href="filmInfo?filmId=${film.f_id}" class="movie-card-buy" data-spm-anchor-id="a1z21.6646273.w2.4">选座购票</a>
                </div>
                </c:forEach>
            </div>

            <!-- 即将热映 -->
            <div class="tab-movie-list" style="display: none;">
                <c:forEach var="films" items="${filmListSoon}">
                <div class="movie-card-wrap">
                    <a href="filmSoon?filmId=${films.f_id}"
                       class="movie-card" data-spm-anchor-id="a1z21.6646273.w2.177">
                        <div class="movie-card-tag"><i class="t-"></i></div>
                        <div class="movie-card-poster">
                            <img width="160" height="224"
                                 src="${pageContext.request.contextPath}${films.img_path}">
                        </div>
                        <div class="movie-card-name">
                            <span class="bt-l">${films.f_name}</span>
                            <span class="bt-r"></span>
                        </div>
                        <div class="movie-card-info">
                            <div class="movie-card-mask"></div>
                            <div class="movie-card-list">
                                <span>导演：${films.f_director}</span>
                                <span>主演：${films.f_players}</span>
                                <span>类型：${films.f_type}</span>
                                <span>地区：${films.f_country}</span>
                                <span>语言：汉语普通话</span>
                                <span>片长：${films.f_length}</span>
                            </div>
                        </div>
                    </a>
                    <a href="filmSoon?filmId=${films.f_id}"
                       class="movie-card-soon" data-spm-anchor-id="a1z21.6646273.w2.178">上映时间<fmt:formatDate value="${films.f_time}" pattern="yyyy-MM-dd"/></a>
                </div>
                </c:forEach>
            </div>

        </div>
    </div>

</div>
<script type="text/javascript">
    $(function () {
        $(".tab-movie-tit").on("click", "a", function () {
            if ($(this).hasClass("current")) {

            } else {
                $(".tab-control-item").removeClass("current");
                $(this).addClass("current");
                if ($(this).attr("id") == "re") {
                    $(".tab-movie-list:eq(1)").attr("style", "display: none;");
                    $(".tab-movie-list:eq(0)").attr("style", "display: inline-block;");
                } else {
                    $(".tab-movie-list:eq(0)").attr("style", "display: none;");
                    $(".tab-movie-list:eq(1)").attr("style", "display: inline-block;");
                }

            }
        })
    })
</script>
</body>

</html>